package com.example.mysaat.handle_utils;

import android.app.Activity;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

public class ManagerActivityUtilProxy <T>{
    //返回一个动态的代理对象
    public T getProxytyInstance(ManagerActivityInterface<Activity> util){
        ClassLoader loader = util.getClass().getClassLoader();
        Class<?>classes[] = util.getClass().getInterfaces();
        InvocationHandler handler = new MyIntovationHandle(util);
        return (T) Proxy.newProxyInstance(loader,classes,handler);
    }
}
